const connect = require('connect');
const http = require('http');
const static = require('serve-static');
const path = require('path');

const middlewares = connect();

// middlewares.use(function (req, res, next) {
//   console.log('middleware1');
//   next();
// });
// middlewares.use(function (req, res, next) {
//   console.log('middleware2');
//   next();
// });
// middlewares.use(function (req, res, next) {
//   res.end('Hello from Connect!');
// });

middlewares.use(static(path.resolve(__dirname, './public')));

http.createServer(middlewares).listen(3000, () => {
  console.log('http://localhost:3000');
});
